
/* TODO*/
// 输入输出流表格
.flow-custom-table.el-table {
  border-radius: 0 0 4px 4px;

  .el-table__row:last-child {
    .el-table__cell:first-child {
      border-radius: 0 0 0 4px;
    }

    .el-table__cell:last-child {
      border-radius: 0 0 4px 0;
    }
  }

  .el-table__inner-wrapper {
    &::before {
      height: 0;
    }
  }

  .el-table__cell {
    padding: 4px 0;
  }

  .el-table__body {
    .cell {
      line-height: 32px;
    }
  }

  .table-dropdown.el-dropdown {
    vertical-align: middle;
  }

  // 调整字体颜色
  .cell {
    color: #51596c;
  }

  th .cell {
    color: #212529;
    font-weight: 500;
  }

  /* input和select的交互 start*/
  .edit-cell-wrapper {
    position: static !important;

    .cell-icon {
      float: left;
      display: none;
      color: #03ac82;
      font-size: 12px;
      cursor: pointer;
    }

    .cell-icon--right {
      float: right;
    }

    .custom-input,
    .custom-select {
      position: absolute;
      left: -1px;
      top: -1px;
      border: 1px solid #03ac82;
      width: calc(100% + 2px);
      border-radius: 0;

      .el-input__wrapper {
        height: 40px;
        box-shadow: none !important;
      }
    }

    .custom-select {
      border-color: transparent;

      &.custom-select--focus {
        border: 1px solid #03ac82;
      }
    }
  }

  // 第一行需要往下1px
  .el-table__row:first-child {

    .custom-input,
    .custom-select {
      top: 0;

      .el-input__wrapper {
        height: 39px;
      }
    }
  }

  .hover-row {
    .edit-cell-wrapper .cell-icon {
      display: inline-block;
    }
  }

  /* input和select的交互 end*/

  &.flow-custom-table--empty {
    border-radius: 0 0 4px 4px;
    border-bottom: 1px solid #ebeef5;
  }
}

// 盘查的表格填写样式（与足迹略有差异）
.fill-cell-wrapper {
  position: static !important;
  &:focus-within {
    .custom-input {
      background: #ffffff;
    }
  }

  .cell-label {
    height: 30px;
    line-height: 30px;

    .cell-icon {
      right: 12px;
      top: 5px;
      color: $themeColor;
    }

    &:hover {
      .cell-icon {
        display: inline-block !important;
      }
    }
  }

  .cell-icon {
    display: none;
    position: absolute;
    right: 0;
    top: 5px;
    font-size: 12px;
  }

  .custom-input,
  .custom-select {
    position: absolute;
    left: -1px;
    top: -1px;
    border: 1px solid transparent;
    width: calc(100% + 2px);
    border-radius: 0;
    z-index: 2;

    .el-input__wrapper {
      height: 40px;
      box-shadow: none !important;
      background: transparent;
    }
    .el-input__inner {
      height: 40px;
      box-shadow: none !important;
      background: transparent;
    }
    
  }

  .custom-select {
    border-color: transparent;

    &.custom-select--focus {
      border: 1px solid #03ac82;
    }
  }

  .el-input__wrapper:focus, .el-input__wrapper.is-focus {
    border: 1px solid #03ac82;

    &+.el-input__suffix {
      .cell-icon {
        display: inline-block !important;
        color: #03ac82;
        z-index: 10;
      }
    }
  }

  .el-select .el-input.is-focus .el-input__wrapper {
    box-shadow: none !important;
  }

  .el-input__wrapper {
    box-shadow: none !important;
  }

  .native-input {
    outline: none;
    border: 1px solid #03AC82;
    width: 100%;
    height: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    top: 0;
    left: 0;
  }

  input::-webkit-input-placeholder {
    color: #CED4DA !important;
  }

  input:-moz-placeholder {
    color: #CED4DA !important;
  }

  input::-moz-placeholder {
    color: #CED4DA !important;
  }

  input:-ms-input-placeholder {
    color: #CED4DA !important;
  }

  input::-ms-input-placeholder {
    color: #CED4DA !important;
  }

  input::placeholder {
    color: #CED4DA !important;
  }

}

// 输入输出流兼容微软雅黑的字体
.is-win {
  .flow-custom-table.el-table {
    th .cell {
      font-weight: 600;
    }
  }
}

// 关联因子表格
.factor-custom-table.el-table {
  .el-table__header {
    tr th {
      background: #f6f9fa;
      line-height: 32px;
    }

    th .cell {
      color: #51596c;
      font-weight: 400;
      line-height: 32px;
    }
  }

  .el-table__cell {
    padding: 4px 0;
  }

  .el-table__body {
    .cell {
      line-height: 32px;
    }
  }

  .edit-cell-wrapper {
    position: static !important;

    .cell-icon {
      float: right;
      display: none;
      color: #03ac82;
      font-size: 12px;
      cursor: pointer;
    }

    .custom-factor-input,
    .custom-factor-select {
      position: absolute;
      left: -1px;
      top: 0;
      border: 1px solid #03ac82;
      width: calc(100% + 1px);
      border-radius: 0;

      .el-input__wrapper {
        height: 48px;
        box-shadow: none !important;
      }
    }

    .custom-factor-input {
      left: 0;
    }

    .custom-factor-select {
      border-color: transparent;

      &.custom-factor-select--focus {
        border: 1px solid #03ac82;
      }
    }
  }

  // 第一个需要右移一个像素
  tr td:first-child {
    .edit-cell-wrapper {
      .custom-factor-input {
        left: 1px;
        width: 100%;
      }
    }
  }

  // 第一行需要往下1px
  .el-table__row:first-child {

    .custom-factor-input,
    .custom-factor-select {
      .el-input__wrapper {
        height: 46px;
      }
    }
  }

  .el-table__row {
    height: 49px;
  }

  .el-table__row:hover {
    .cell-icon {
      display: inline-block;
    }
  }
}

// 表格中的loading
.table-custom-loading {
  :deep(.el-loading-spinner .circular) {
    width: 20px;
  }
}


/* 分页器 */
.g-pagination.el-pagination {
  padding-right: 0;

  .el-pagination__total {
    height: 32px;
    line-height: 32px;
  }

  .el-pagination__sizes {
    height: 32px;

    .el-input__wrapper {
      height: 32px;
    }

    .el-input__suffix {
      right: 8px;
    }
  }

  button {
    min-width: 32px;
  }

  .btn-prev,
  .btn-next {
    padding: 0 6px;
    width: 32px;
    height: 32px;
    border-radius: 2px;
    border: 1px solid #ebeef5;
  }

  .btn-prev {
    margin-right: 8px;
  }

  .btn-next {
    margin-left: 8px;
  }

  .el-pager li {
    margin: 0;
    min-width: 32px;
    height: 32px;
    line-height: 32px;
  }

  .el-pager li.active {
    background: var(--el-pagination-hover-color);
    color: #ffffff;
    box-shadow: 0px 2px 2px 0px rgba(3, 172, 130, 0.1);
    border-radius: 2px;
  }

  .el-pagination__jump,
  .el-pagination__jump .el-input,
  .el-pagination__jump .el-input__wrapper {
    height: 32px;
  }
}

/* 表格 */
.g-base-table.el-table {
  &.g-base-table--t-b {
    border-top: 1px solid #ebeef5;
  }

  th.el-table__cell {
    padding: 4px 0;

    &>.cell {
      font-size: 12px;
      color: #212529;
      font-weight: 500;
    }
  }

  .el-table__header th.el-table__cell,
  .el-table__body td.el-table__cell {
    &:first-child {
      &>.cell {
        padding-left: 24px;
      }
    }

    &:last-child {
      &>.cell {
        padding-right: 24px;
      }
    }
  }

  .el-table__header .el-table-column--selection .cell {
    display: flex;
    align-items: center;
    line-height: 23px;
  }
}

// windows系统下表头需要加粗
.is-win {
  .g-base-table.el-table {
    th.el-table__cell {
      &>.cell {
        font-weight: 600;
      }
    }
  }
}


.g-base-table-v2 {
  // 表格边框颜色
  --el-border-color-lighter: #e4e7ed;
  .el-table__header th.el-table__cell {
    background: rgba(246, 249, 250, 1);
    padding: 4px 0;

    &>.cell {
      font-size: 14px;
      color: #212529;
      font-weight: bold;
      line-height: 24px;
    }
  }

  .el-table__body td.el-table__cell {
    &>.cell {
      font-size: 14px;
      font-weight: 400;
      color: #51596C;
      line-height: 24px;
    }
  }

  .el-table__header th.el-table__cell,
  .el-table__body td.el-table__cell {
    &>.cell {
      padding-left: 19px;
      padding-right: 19px;
    }
  }
}